package com.fckbug.action.user;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.fckbug.service.UserService;
import com.fckbug.util.SpringContextHolder;

/**
 * 查看用户排名列表
 * @author think
 *
 */
public class ListUsersAction extends Action {
	UserService userService = (UserService)SpringContextHolder.getBean("userService");
	
	public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response) throws Exception {
		List users = userService.listTopUsers();
		request.setAttribute("users", users);
		return mapping.findForward("success");
	}
}
